#pragma once

#include <pcap.h>
#include <boost/shared_ptr.hpp>
#include "PCapWrapper.h"
#include "utils.h"

namespace Broady {

class Sniffer
{
public:
	bool Init( PCap::DevicePtr dev );
	void Quit( void );
	bool Step( void );

private:
	bool FilterPacket( ip_header* ih, udp_header* uh ) const;
	static void PacketHandler( unsigned char* param, const struct pcap_pkthdr* header, const unsigned char* pkt_data );

private:
	boost::shared_ptr<PCap> m_handle;
	ip_address m_ip;
};

} // namespace
